Boot Sector Internals

On this page you will find details of the boot sector.

The boot sector has not yet been released as there is no boot loader for it to load.

Tools Used:

Memory Map:

All start and end values are a 20 bit hexadecimal address
The size in decimal

Start End Size Description
00000 00400 1024 Interrupt Vector table
00400 00520 288 BIOS data areas
00520 00720 512 Copy of boot sector for main loader
00720 00800 224 Stack
00800 10800 65536 The boot loader

Details

The boot sector is loaded by the BIOS into address 0000:7C00. It is executed at that point. Because at the moment the only filesystem supported is FAT, there is 59 bytes of the boot sector reserved by DOS for the details of the disk, which are used during boot up. This takes address 03h to 3Eh.

The boot sector makes two copies of itself. The first is at 0000:0520 and is provided so the boot loader that is loaded knows which drive it was booted from and how to access it.

The second copy is a temporary copy at address 2000:7C00 which is so the boot loader can be loaded where the BIOS originally placed out boot sectors. A 7C00h offset is used to ensure that all address offsets still work correctly.

A cursory check of the processor is made of the processor to ensure a 386 or better is present. Doing this at an early stage enables 32 bit arithmetic to be performed with ease, which is great help when working with sectors numbered from the start of the disk. (ie Sector numbers before resolved into a CHS form).

Using the fields provided by DOS in the boot sector, the start of the data area on the boot disk is calculated. The boot sector expects the first 64kB of this space to contain the boot loader. Because of this, the "sys" program when written will have to mark this area used in the FAT table and create a file entry in the root directory of the disk to claim it. This has not yet been written however.

The loader is jumped to with a far absolute jump so it is entered at a 0 offset. The address jumped to is 0800:0000.

Improvements Planned

If you have any ideas please email them to Guy Thornley


Back to WOS boot team page